package com.wwmz.facade.pattern.gift;

/**
 * Created by wumz on 2020/9/19 20:25
 */
public class FacadeService {
    private IntegralService integralService = new IntegralService();
    private PayService payService = new PayService();
    private LogisticsService logisticsService = new LogisticsService();


    public void exchange(GiftInfo giftInfo){
        if(integralService.isAvailable(giftInfo)){
            if(payService.pay(giftInfo)){
                String shippingNo = logisticsService.delivery(giftInfo);
                System.out.println("物流系统下单成功，物流单号是：" + shippingNo);
            }
        }
    }
}
